`:top
The `!Java Packager tool`! is a tool included in the JDK which allows to package Java applications from the command line. It is an alternative to using other packaging tools like `F33f`_`[Apache Ant`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Apache_Ant]`_`f.`:cite-ref-1[`F5bf`_`[1`#cite-note-1]`_`f]
Note that the Java Packager does not automatically produce a `F33f`_`[Jar file`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=JAR_(file_format)]`_`f. Many other formats are available, including native executable formats for the platform.
The Java Packager tool also manipulates `F33f`_`[modules`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Java_Platform_Module_System]`_`f (added in Java 9), allowing for example to package a module and all the modules it depends on.`:cite-ref-2[`F5bf`_`[2`#cite-note-2]`_`f]
>>Contents
• `F0af`_`[Example`#example]`_`f
• `F0af`_`[References`#references]`_`f
• `F0af`_`[External links`#external-links]`_`f
-─
>>Example
For example, the following command will create a `*outputJar.jar`* file with the content of the `*classesDir`* directory, and will set the `*myPackager.MainClass`* as the executable class of the jar file:
`B100`F9d9javapackager -createjar -appclass myPackager.MainClass -srcdir classesDir -outdir out -outfile outputJar -v`f`b
>>References
`:cite-note-1`!1.`! `F0af`_`[↑`#cite-ref-1]`_`f "The Java Packager Tool". `F33f`_`[Oracle Corporation`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Oracle_Corporation]`_`f. Retrieved 2017-07-31.
`:cite-note-2`!2.`! `F0af`_`[↑`#cite-ref-2]`_`f "JEP 275: Modular Java Application Packaging". `F33f`_`[Oracle Corporation`:/page/wikibook/entry.mu`zim=wikipedia_en_all_nopic_2025-08.zim|entry_path=Oracle_Corporation]`_`f. Retrieved 2017-07-31.
>>External links
• the Java packager tool
`c`F0af`_`[↑ Back to top`#top]`_`f`a